

import 'package:flutter/material.dart';

class WidgetTitle extends StatelessWidget {

  final String title;
  final Function onTap;
  final Icon icon;

  WidgetTitle(this.title, {this.icon, this.onTap});

  @override
  Widget build(BuildContext context) {
    String title = this.title;
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        Text(
          title,
          style: TextStyle(fontSize: 18),
        ),
        GestureDetector(
          onTap: this.onTap,
          child: icon,
        ),
      ],
    );
  }

}